package ren.kane.asdppp.classification;

import ren.kane.asdppp.transaction.cost.SalesReceipt;
import ren.kane.asdppp.transaction.pay.Paycheck;

import java.time.LocalDate;
import java.util.HashMap;
import java.util.Map;

/**
 * @author renrk(1275) on 2019-04-15 7:20 PM
 **/
public class CommissionedClassification implements PaymentClassification {

    private double salary;

    private double commissionRate;

    private Map<LocalDate, SalesReceipt> salesReceiptMap = new HashMap<>();

    public CommissionedClassification() {
    }

    public CommissionedClassification(double salary, double commissionRate) {
        this.salary = salary;
        this.commissionRate = commissionRate;
    }

    public double getSalary() {
        return salary;
    }

    public double getCommissionRate() {
        return commissionRate;
    }

    public SalesReceipt getSalesReceipt(LocalDate date) {
        return salesReceiptMap.get(date);
    }

    public void addSalesReceipt(SalesReceipt salesReceipt) {
        salesReceiptMap.put(salesReceipt.getDate(), salesReceipt);
    }

    @Override
    public double calculatePay(Paycheck paycheck) {
        return 0;
    }
}
